<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
/*
	开发者资料管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op'] == 'get'){
	$return=cloud_request('update.developer.get');
	if($return['item']['picurl']){
		$_SESSION['cloud_picurl']=$return['item']['picurl'];
	}
	$return['item']['myshop_domain']=SITEROOT;
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'开发者资料（这里是显示在进云市场的资料）',
		'edit'=>array(
			array('type'=>'copy','title'=>'我的云ID','name'=>'uniacid'),
			array('type'=>'img_show','width'=>'180','name'=>'kefuqunewm','title'=>'企业微信开发者群二维码','help'=>'用企业微信扫描上面二维码！'),
			array('type'=>'radio','title'=>'开发者类型','name'=>'type','options'=>'types','help'=>'选择开发者类型'),
			array('type'=>'string','title'=>'姓名','name'=>'name','show'=>array('type',1)),
			array('type'=>'image','title'=>'头像','name'=>'image'),
			array('type'=>'string','title'=>'公司名称','name'=>'name','show'=>array('type',2)),
			array('type'=>'string','title'=>'身份证号码','name'=>'number','show'=>array('type',1)),
			array('type'=>'string','title'=>'营业执照编号','name'=>'number','show'=>array('type',2)),
			array('type'=>'image','title'=>'身份证正面照','name'=>'picurl','show'=>array('type',1)),
			array('type'=>'image','title'=>'营业执照正面照','name'=>'picurl','show'=>array('type',2)),
			array('type'=>'string','title'=>'结算支付宝账号','name'=>'alipay'),
			array('type'=>'string','title'=>'联系手机','name'=>'mobile'),
			array('type'=>'string','title'=>'在线QQ','name'=>'qq'),
			array('type'=>'switch','title'=>'开放个人市场？','name'=>'myshop_open','help'=>'[温馨提示]：开放个人市场后，在其他站点后台，可以看到您的应用市场！'),
			array('type'=>'copy','title'=>'个人市场域名url','name'=>'myshop_domain','help'=>'例如：http://www.xxx.com,需要带http'),
			array('type'=>'string','title'=>'个人市场名称','name'=>'myshop_title'),
			array('type'=>'string','title'=>'个人市场描述','name'=>'myshop_desc'),
			array('type'=>'image','title'=>'个人市场logo','name'=>'myshop_logo'),
			array('type'=>'string','title'=>'支持哪些开发者代销？','name'=>'myshop_authids','help'=>'填写开发者ID，用|隔开，例如：68|88。被支持的开发者，可以一键发布你的应用（已经发布到进云市场的）到他的个人应用市场！'),
		)
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op'] == 'post'){
	$post=get_postdata();
	$data=array_fields(array('type','name','number','alipay','mobile','qq','myshop_open','myshop_domain','myshop_title','myshop_desc','myshop_logo','myshop_authids'),$post);
	if($post['image'] && substr($post['image'],0,5)=='image'){
		$data['image']=tomedia($post['image']);
	}
	if($post['picurl'] && substr($post['picurl'],0,5)=='image'){
		$data['picurl']=tomedia($post['picurl']);
	}
	$data['myshop_logo']=$post['myshop_logo']?tomedia($post['myshop_logo']):'';
	$return=cloud_request('update.developer.post',$data);
	exi($return);
}